package com.huawei.appgallery.festivalanimation.particle.initializers;

import com.huawei.appgallery.festivalanimation.particle.Particle;
import com.huawei.appgallery.festivalanimation.particle.utils.RandomUtil;

public class AlphaInitializer implements IParticleInitializer {
    private int mMaxAlpha;
    private int mMinAlpha;

    public AlphaInitializer(int i, int i2) {
        this.mMinAlpha = i;
        this.mMaxAlpha = i2;
    }

    public void initParticle(Particle particle) {
        particle.mAlpha = this.mMaxAlpha == this.mMinAlpha ? this.mMinAlpha : RandomUtil.nextInt(this.mMaxAlpha - this.mMinAlpha) + this.mMinAlpha;
        particle.mInitialAlpha = particle.mAlpha;
    }
}
